/**
 * Created by rongyao on 2017/11/14.
 */
const initialState = {
	count:0,
	newsList:[],
	productList:[],
	cateList:[],
	commentList:[],
	shopCar:[]
}
function reducer(state=initialState,action) {
	switch(action.type){
		case "INCREASE":
			return Object.assign({},state,{count:state.count+1});
		case "GETNEWSLIST":
			return Object.assign({},state,{newsList:action.data});
		case "GETPRODUCTLIST":
			return Object.assign({},state,{productList:action.data});
		case "GETCATELIST":
			return Object.assign({},state,{cateList:action.data});
		case "GETCOMMENTLIST":
			return Object.assign({},state,{commentList:action.data});
		case "ADDSHOPCAR":
			return Object.assign({},state,{commentList:action.data});
		default:
			return state;
	}
}
export default reducer;